package com.wangsd.common.component.extBean;

import com.github.binarywang.wxpay.bean.result.BaseWxPayResult;
import com.thoughtworks.xstream.XStream;
import com.thoughtworks.xstream.annotations.XStreamAlias;
import me.chanjar.weixin.common.util.xml.XStreamInitializer;

/**
 * 支付押金（人脸支付）
 */
@XStreamAlias("xml")
public class DepositConsumeResponse extends BaseWxPayResult {
    @XStreamAlias("transaction_id")
    private String transactionId;

    @XStreamAlias("out_order_no")
    private String outOrderNo;

    @XStreamAlias("consume_fee")
    private Integer consumeFee;

    @XStreamAlias("total_fee")
    private Integer totalFee;

    public static DepositConsumeResponse fromXML(String xmlString) {
        XStream xstream = XStreamInitializer.getInstance();
        xstream.allowTypesByWildcard(new String[]{"me.chanjar.weixin.**",
                "cn.binarywang.wx.**", "com.github.binarywang.**",
                "com.wangsd.common.component.**"});
        xstream.processAnnotations(DepositConsumeResponse.class);
        DepositConsumeResponse result = (DepositConsumeResponse) xstream.fromXML(xmlString);
        result.setXmlString(xmlString);
        return result;
    }

    public String getTransactionId() {
        return transactionId;
    }

    public void setTransactionId(String transactionId) {
        this.transactionId = transactionId;
    }

    public String getOutOrderNo() {
        return outOrderNo;
    }

    public void setOutOrderNo(String outOrderNo) {
        this.outOrderNo = outOrderNo;
    }

    public Integer getConsumeFee() {
        return consumeFee;
    }

    public void setConsumeFee(Integer consumeFee) {
        this.consumeFee = consumeFee;
    }

    public Integer getTotalFee() {
        return totalFee;
    }

    public void setTotalFee(Integer totalFee) {
        this.totalFee = totalFee;
    }
}
